package com.net.shop.car.manager.ui.adapter;

import java.util.ArrayList;

import com.net.shop.car.manager.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class OilCardDetailAdapter extends BaseAdapter {
	private Context mContext;
	private ArrayList<com.net.shop.car.manager.api.volley.response.oil.OilHuaBoResponse.Detail> data;

	public OilCardDetailAdapter(Context mContext, ArrayList<com.net.shop.car.manager.api.volley.response.oil.OilHuaBoResponse.Detail> data) {
		super();
		this.mContext = mContext;
		this.data=data;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View contentView, ViewGroup arg2) {
		// TODO Auto-generated method stub
		Holdler holdler;
		if (contentView == null) {
			holdler = new Holdler();
			contentView = LayoutInflater.from(mContext).inflate(
					R.layout.item_oil_detail, null);
			holdler.od_money = (TextView) contentView
					.findViewById(R.id.od_money);
			holdler.od_time = (TextView) contentView.findViewById(R.id.od_time);
			holdler.od_image1 = (TextView) contentView
					.findViewById(R.id.od_image1);
			contentView.setTag(holdler);
		} else {
			holdler = (Holdler) contentView.getTag();
		}
		holdler.od_money.setText("￥ "+data.get(position).Monney);
		holdler.od_time.setText(data.get(position).Date);
		holdler.od_image1.setText(data.get(position).PiCi);
		return contentView;
	}

	class Holdler {
		private TextView od_money;
		private TextView od_time;
		private TextView od_image1;

	}

	
}
